import axios from 'axios';
const queryString = require('query-string');


var common_axios=axios.create({
	baseURL: '/panel'
});

common_axios.interceptors.request.use(
	(config)=>{
		config.data=queryString.stringify(config.data);
		return config;
	},(error)=>{
		return Promise.reject(error);
	}
);
common_axios.interceptors.response.use(
	(response)=>{
		return response;
	},(error)=>{
		if(error.response) {
		}
		return Promise.reject(error);
	}
);

export default{
	//初始化数据库
	databaseInit:function(data,params){
		return common_axios.post("/data-base-init",data,{params:params });
	}
}
